<?php
/**
 * @package		mod_qlform
 * @copyright	Copyright (C) 2012 ql.de All rights reserved.
 * @author 		Mareike Riegel mareike.riegel@ql.de
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
// no direct access
defined('_JEXEC') or die;
?>
<form method="post" action="<?php echo $action; ?>" id="mod_qlform_<?php echo $module->id;?>" class="form-validate">

	<?php 
	if (1==$params->get('addPostToForm') AND isset($array_posts) AND is_array($array_posts)) : foreach ($array_posts as $k=>$v) :?>
	<!-- input type="hidden" name="former[<?php echo $k;?>]" value="<?php echo $v;?>" /-->
	<input type="hidden" name="former[<?php echo $k;?>]" value="<?php echo $v;?>" /><?php 
	endforeach; endif; ?>
    <input name="formSent" type="hidden" value="1" />
	<dl><?php
		foreach ($form->getFieldsets() as $fieldset): 
			$fields = $form->getFieldset($fieldset->name);
			foreach($fields as $field): 
				if ($field->hidden): echo $field->input; 
				else: ?>
				<dt class="<?php echo $field->id;?>">
	            	<?php echo $field->label; ?>
	                <?php if (!$field->required && $field->type != "Spacer") echo ""; ?>
	            </dt>
	            <dd class="<?php echo $field->id;?>">
	            	<?php echo $field->input;?>
	            </dd>
	            <?php endif;
	        endforeach;
		endforeach; ?>
	<?php if (1==$showCaptacha) : ?>
		<dt class="captcha">
		<?php if(""!=$params->get('captchalabel')) echo "<span>".$params->get('captchalabel')."</span><br />";?>
		<img id="captcha" src="<?php echo $image;?>" /></dt>
		<dd class="captcha"><?php if(""!=$params->get('captchadesc')) echo "<span>".$params->get('captchadesc')."</span><br />";?><input type="text" name="captcha" value="" /></dd>	
	<?php endif; ?>
	<dt class="submit"></dt><dd class="submit"><input type="submit" value="<?php echo $submit; ?>" /></dd>
	</dl>
	<?php if (1==$fieldModuleId) : ?>
		<input type="hidden" value="<?php echo $moduleId;?>" name="moduleId" />	
	<?php endif; ?>	
</form>